<?php
/**
 * Created by PhpStorm.
 * UserModel: Administrator
 * Date: 2019/3/01/0001
 * Time: 10:40
 */
namespace app\caidongweb\controller;
use app\caidongweb\model\AdminModel;
use think\Controller;
use think\Session;
class Login extends Controller
{
    //登录
    public function login()
    {
        if(input('post.')){
            $adminModel = new AdminModel();
            $res = $adminModel->login();
            return $res;
        }else{
            //临时关闭当前模板的布局功能
            $this->view->engine->layout(false);
            return view('login/login');
        }
    }
    //退出
    public function logout()
    {
        Session::set('uid','');
        Session::set('userData','');
        return view('login/login');
    }
}